<template>
  <div class="get-deals-with-network">
    <div class="title">网点包裹回收排行榜</div>
    <div class="chart" id="dealsChart"></div>
  </div>
</template>

<script>
export default {
  name: "get-deals-with-network",
  data() {
    return {
      option: {
        grid: {
          left: "5%",
          right: "4%",
          bottom: "3%",
          top: "3%",
          containLabel: true,
        },
        xAxis: {
          type: "value",
          boundaryGap: [0, 0.01],
          splitLine: {
            show: false,
          },
          axisLine: {
            show: false,
          },
          axisLabel: {
            show: false,
          },
        },
        yAxis: [
          {
            type: "category",
            data: [
              "巴西",
              "印尼",
              "美国",
              "印度",
              "中国",
              "中国",
              "中国",
              "中国",
              "中国",
              "中国",
            ],
            axisTick: {
              show: false,
            },
            axisLine: {
              show: false,
            },
            axisLabel: {
              color: "#FFFFFF",
              fontSize: "16",
              margin: 15,
            },
          },
          {
            type: "category",
            data: [
              "15%",
              "15%",
              "15%",
              "15%",
              "15%",
              "15%",
              "15%",
              "15%",
              "15%",
              "15%",
            ],
            axisTick: {
              show: false,
            },
            axisLine: {
              show: false,
            },
            axisLabel: {
              color: "#FFFFFF",
              fontSize: "16",
              margin: 15,
            },
          },
        ],
        series: [
          {
            name: "2011年",
            type: "bar",
            data: [100, 200, 300, 400, 500, 600, 100, 100, 100, 100, 100],
            itemStyle: {
              normal: {
                barBorderRadius: [20, 20, 20, 20],
                // color: "#00ED3B",
                // lineStyle: {
                //   //线的颜色
                //   color: "#00ED3B",
                // },
                color: this.$echarts.graphic.LinearGradient(
                  1,
                  0,
                  0,
                  0,
                  //三种由深及浅的颜色
                  [
                    {
                      offset: 0,
                      color: "#00ED3B",
                    },
                    {
                      offset: 1,
                      color: "rgba(233, 247, 255, 0.65)",
                    },
                  ]
                ),
              },
            },
          },
        ],
      },
    };
  },
  mounted() {
    const chartDom = document.getElementById("dealsChart");
    const myChart = this.$echarts.init(chartDom);
    myChart.setOption(this.option);
  },
};
</script>

<style lang="scss" scoped>
.get-deals-with-network {
  width: 453px;
  height: 437px;

  .title {
    height: 60px;
    line-height: 60px;
    padding-left: 33px;
    font-weight: bold;
    font-size: 24px;
    color: #ffffff;
  }
  .chart {
    height: 377px;
  }
}
</style>